package models;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
@Table(name = "t_DateReport")
public class DateReport_P_Entity implements Serializable{
    private static final long serialVersionUID = 1L;

    private String reportDate;
    private String khmc;
    private String hwmc;
    private BigDecimal hwzl;
//    private Integer trips;

    @Id
    @Column(name = "ReportRQ", nullable = true, length = 100)
    public String getReportDate() {
        return reportDate;
    }

    public void setReportDate(String reportDate) {
        this.reportDate = reportDate;
    }

    @Id
    @Column(name = "KHMC", nullable = true, length = 100)
    public String getKhmc() {
        return khmc;
    }

    public void setKhmc(String khmc) {
        this.khmc = khmc;
    }

    @Id
    @Column(name = "HWMC", nullable = true, length = 100)
    public String getHwmc() {
        return hwmc;
    }

    public void setHwmc(String hwmc) {
        this.hwmc = hwmc;
    }

    @Id
    @Column(name = "HWZL", nullable = true, precision = 2)
    public BigDecimal getHwzl() {
        return hwzl;
    }

    public void setHwzl(BigDecimal hwzl) {
        this.hwzl = hwzl;
    }

//    @Id
//    @Column(name = "TRIPS", nullable = true, length = 20)
//    public Integer getTrips() {
//        return trips;
//    }
//
//    public void setTrips(Integer trips) {
//        this.trips = trips;
//    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DateReport_P_Entity that = (DateReport_P_Entity) o;
        return Objects.equals(reportDate, that.reportDate) &&
                Objects.equals(khmc, that.khmc) &&
                Objects.equals(hwmc, that.hwmc) &&
                Objects.equals(hwzl, that.hwzl) ;
//                && Objects.equals(trips, that.trips)
    }

    @Override
    public int hashCode() {

        return Objects.hash(reportDate, khmc, hwmc, hwzl);
//        , trips
    }
}
